#include "data_global.h"
extern pthread_mutex_t mutex_led;
extern pthread_cond_t cond_led;
extern unsigned char dev_led_mask;
extern int dev_led_fd;
void *pthread_led(void*led_msg)
{
	puts("pthread_led ok!!!");
	while(1)
	{
		pthread_mutex_lock(&mutex_led);        //add lock

		pthread_cond_wait(&cond_led,&mutex_led);
		dev_led_fd = open(DEV_LED,O_RDWR);

		if(dev_led_fd == -1)
		{
			perror("open led failed");
			return NULL;
		}
		ioctl(dev_led_fd,dev_led_mask);
		pthread_mutex_unlock(&mutex_led);
		usleep(10000);
		close(dev_led_fd);
	}
}
